<%@ include file="/taglibs.jsp"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<fmt:message key="date.format" var="df" scope="page"/>
<head>
	<title><fmt:message key="statisticsFileByDepartment.form.title"/></title>
</head>

<s:form name="statisticsByDepartmentForm" action="showStatisticsByDepartment" method="post" validate="true">
<table class="table">
<tr>
	<td width="130px">
        <s:property value="getText('statisticsFileByDepartment.form.label.selectgroup')"/>
    </td>
	<td colspan="3">
		<s:select name="groupId" list="lstDepartments" listKey="id" listValue="name" theme="simple" headerKey="%{getText('select.default.key')}" headerValue="%{getText('select.default.value')}"/>
	</td>
</tr>
<tr>
	<td>
        <s:property value="getText('report.fromdate')"/>
    </td>
    <td>
        <s:textfield id="fromDate" readonly="true" name="fromDate" size="11" theme="simple" required="true"/>
    </td>
	<td width="80px">
        <s:property value="getText('report.todate')"/>
    </td>
    <td>
        <s:textfield id="toDate" name="toDate" readonly="true" size="11" theme="simple" required="true"/>
    </td>     
</tr>   
<tr>
	<td colspan="4">
	
	<button type="submit" onclick="this.blur()" class="button"
					name="reportOnTime">
					<fmt:message key="button.execute.title"></fmt:message>
					<img src="${ctx}/images/report.png" align="left" height="20"
						width="20">
				</button>
	</td>
</tr>
   </table>

</s:form>
<s:set name="lstReportByDepartment" value="lstReportByDepartment" scope="request"/>
<display:table  name="lstReportByDepartment" class="table" requestURI="" id="department" export="false" pagesize="10" >
    <display:column property="fullname" sortable="false" media="html" titleKey="statisticsFileByDepartment.form.table.header.user" />
    <display:column property="totalFile" sortable="false" media="html" titleKey="statisticsFileByDepartment.form.table.header.total" />
    <display:column property="totalOvertime" sortable="false" media="html" titleKey="statisticsFileByDepartment.form.table.header.totalOvertime" />
</display:table>


<script type="text/javascript">//<![CDATA[
$(document).ready(function (){
	var currentTime = new Date();
	var month = currentTime.getMonth() + 1;
	var day = currentTime.getDate();
	if(month < 10) month = "0" + month;
	if(day < 10) day = "0" + day;
	var year = currentTime.getFullYear();
	
	var today = day + "/" + month + "/" + year;
	
	if($("#fromDate").val()=="")
  		$("#fromDate").val(today);
	
	if($("#toDate").val()=="")
  		$("#toDate").val(today);
});


      var cal = Calendar.setup({
          onSelect: function(cal) { cal.hide();},
      });
      cal.manageFields("fromDate","fromDate","%d/%m/%Y");
      cal.manageFields("toDate","toDate","%d/%m/%Y");
      
    //]]></script>